package com.simple.puzzle;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.widget.TextView;

public class About extends Activity{

	TextView app_name;
	TextView version;
	TextView create_by;
	TextView contact_to;
	TextView info;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about);
		
		app_name = (TextView) findViewById(R.id.app_name);
		version = (TextView) findViewById(R.id.version);
		create_by = (TextView) findViewById(R.id.create_by);
		contact_to = (TextView) findViewById(R.id.contact_to);
		info = (TextView) findViewById(R.id.info);
		
		Context context = getApplicationContext();
		app_name.setText(String.format("About: %s", context.getString(R.string.app_name)));
		
		try {
			PackageInfo pinfo = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_META_DATA);
			version.setText(String.format("Version: %s", pinfo.versionName));
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		create_by.setText("Created by: Le Van Nghia");
		contact_to.setText("Contact to: nghialv.bk@gmail.com");
		info.setText("");
		
	}
}
